home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / GXMessages.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  5.9 KB  |  208 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        GXMessages.h
  3.  
  4.      Contains:    This file contains all of the public data structures,
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __GXMESSAGES__
  19. #define __GXMESSAGES__
  20.  
  21. #ifndef __CONDITIONALMACROS__
  22. #include <ConditionalMacros.h>
  23. #endif
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. #ifndef __MIXEDMODE__
  28. #include <MixedMode.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. #if defined(__MWERKS__) && TARGET_CPU_68K
  54.     #pragma push
  55.     #pragma pointers_in_D0
  56. #endif
  57.  
  58.  
  59. /*
  60.  
  61.     >>>>>> CONSTANTS <<<<<<
  62.  
  63. */
  64. /* Message Manager Trap */
  65.  
  66. enum {
  67.     messageManagerTrap            = 0xABFB
  68. };
  69.  
  70.  
  71. /* Message Manager Error Result Codes */
  72.  
  73. enum {
  74.     messageStopLoopingErr        = -5775,
  75.     cantDeleteRunningHandlerErr    = -5776,
  76.     noMessageTableErr            = -5777,
  77.     dupSignatureErr                = -5778,
  78.     messageNotReceivedErr        = -5799
  79. };
  80.  
  81.  
  82. /*
  83.     DATA TYPES
  84. */
  85. typedef CALLBACK_API_C( OSErr , MessageHandlerOverrideProcPtr )(long arg1, long arg2, long arg3, long arg4, long arg5, long arg6);
  86. typedef STACK_UPP_TYPE(MessageHandlerOverrideProcPtr)             MessageHandlerOverrideUPP;
  87. enum { uppMessageHandlerOverrideProcInfo = 0x0003FFE1 };         /* 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  88. #define NewMessageHandlerOverrideProc(userRoutine)                 (MessageHandlerOverrideUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageHandlerOverrideProcInfo, GetCurrentArchitecture())
  89. #define CallMessageHandlerOverrideProc(userRoutine, arg1, arg2, arg3, arg4, arg5, arg6)  CALL_SIX_PARAMETER_UPP((userRoutine), uppMessageHandlerOverrideProcInfo, (arg1), (arg2), (arg3), (arg4), (arg5), (arg6))
  90. typedef CALLBACK_API_C( void , MessageGlobalsInitProcPtr )(void *messageGlobals);
  91. typedef STACK_UPP_TYPE(MessageGlobalsInitProcPtr)                 MessageGlobalsInitUPP;
  92. enum { uppMessageGlobalsInitProcInfo = 0x000000C1 };             /* no_return_value Func(4_bytes) */
  93. #define NewMessageGlobalsInitProc(userRoutine)                     (MessageGlobalsInitUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageGlobalsInitProcInfo, GetCurrentArchitecture())
  94. #define CallMessageGlobalsInitProc(userRoutine, messageGlobals)  CALL_ONE_PARAMETER_UPP((userRoutine), uppMessageGlobalsInitProcInfo, (messageGlobals))
  95. #if OLDROUTINENAMES
  96. typedef MessageHandlerOverrideProcPtr     MessageHandlerOverrideProc;
  97. typedef MessageGlobalsInitProcPtr         MessageGlobalsInitProc;
  98. #endif  /* OLDROUTINENAMES */
  99.  
  100. typedef struct OpaqueMessageHandler*     MessageHandler;
  101. typedef struct OpaqueMessageObject*     MessageObject;
  102. /*
  103.  
  104.     PUBLIC INTERFACES
  105.  
  106.     Message Handler API Routines
  107. */
  108. EXTERN_API_C( long )
  109. CountMessageHandlerInstances    (void)                                                        TWOWORDINLINE(0x7028, 0xABFB);
  110.  
  111. EXTERN_API_C( void *)
  112. GetMessageHandlerClassContext    (void)                                                        TWOWORDINLINE(0x7029, 0xABFB);
  113.  
  114. EXTERN_API_C( void *)
  115. SetMessageHandlerClassContext    (void *                    anyValue)                            TWOWORDINLINE(0x702A, 0xABFB);
  116.  
  117. EXTERN_API_C( void *)
  118. GetMessageHandlerInstanceContext (void)                                                        TWOWORDINLINE(0x702B, 0xABFB);
  119.  
  120. EXTERN_API_C( void *)
  121. SetMessageHandlerInstanceContext (void *                anyValue)                            TWOWORDINLINE(0x702C, 0xABFB);
  122.  
  123. EXTERN_API_C( OSErr )
  124. NewMessageGlobals                (long                     messageGlobalsSize,
  125.                                  MessageGlobalsInitUPP     initProc)                            TWOWORDINLINE(0x702D, 0xABFB);
  126.  
  127. EXTERN_API_C( void )
  128. DisposeMessageGlobals            (void)                                                        TWOWORDINLINE(0x702E, 0xABFB);
  129.  
  130. /*
  131.     Message Sending API Routines
  132. */
  133.  
  134.  
  135. #ifndef BUILDING_GXMESSAGES
  136. EXTERN_API_C( OSErr )
  137. SendObjectMessage                (MessageObject             msgObject,
  138.                                  long                     messageSelector,
  139.                                  ...)                                                        FIVEWORDINLINE(0x205F, 0x221F, 0x702F, 0xABFB, 0x518F);
  140.  
  141. EXTERN_API_C( OSErr )
  142. SendObjectMessageTo                (MessageObject             msgObject,
  143.                                  long                     messageSelector,
  144.                                  MessageHandler         msgHandler,
  145.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7030, 0xABFB, 0x9EFC, 0x000C);
  146.  
  147. EXTERN_API_C( OSErr )
  148. SendObjectMessageFor            (MessageObject             msgObject,
  149.                                  long                     messageSelector,
  150.                                  MessageHandler         msgHandler,
  151.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7037, 0xABFB, 0x9EFC, 0x000C);
  152.  
  153. EXTERN_API_C( OSErr )
  154. StartObjectMessageAt            (MessageObject             msgObject,
  155.                                  long                     messageSelector,
  156.                                  MessageHandler         msgHandler,
  157.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7031, 0xABFB, 0x9EFC, 0x000C);
  158.  
  159. EXTERN_API_C( OSErr )
  160. SendMessage                        (long                     messageSelector,
  161.                                  ...)                                                        FOURWORDINLINE(0x221F, 0x7032, 0xABFB, 0x598F);
  162.  
  163. EXTERN_API_C( OSErr )
  164. SendMessageTo                    (long                     messageSelector,
  165.                                  MessageHandler         msgHandler,
  166.                                  ...)                                                        FIVEWORDINLINE(0x221F, 0x241F, 0x7033, 0xABFB, 0x518F);
  167.  
  168. EXTERN_API_C( OSErr )
  169. StartMessageAt                    (long                     messageSelector,
  170.                                  MessageHandler         msgHandler,
  171.                                  ...)                                                        FIVEWORDINLINE(0x221F, 0x241F, 0x7034, 0xABFB, 0x518F);
  172.  
  173. EXTERN_API_C( OSErr )
  174. ForwardMessage                    (long                     messageSelector,
  175.                                  ...)                                                        FOURWORDINLINE(0x221F, 0x7035, 0xABFB, 0x598F);
  176.  
  177. EXTERN_API_C( OSErr )
  178. ForwardThisMessage                (void *                    parameter1,
  179.                                  ...)                                                        TWOWORDINLINE(0x7036, 0xABFB);
  180.  
  181. #endif    /* BUILDING_GXMESSAGES */
  182.  
  183. #if defined(__MWERKS__) && TARGET_CPU_68K
  184.     #pragma pop
  185. #endif
  186.  
  187.  
  188. #if PRAGMA_STRUCT_ALIGN
  189.     #pragma options align=reset
  190. #elif PRAGMA_STRUCT_PACKPUSH
  191.     #pragma pack(pop)
  192. #elif PRAGMA_STRUCT_PACK
  193.     #pragma pack()
  194. #endif
  195.  
  196. #ifdef PRAGMA_IMPORT_OFF
  197. #pragma import off
  198. #elif PRAGMA_IMPORT
  199. #pragma import reset
  200. #endif
  201.  
  202. #ifdef __cplusplus
  203. }
  204. #endif
  205.  
  206. #endif /* __GXMESSAGES__ */
  207.  
  208.